/*
 * Copyright (c) 2019-2022. Alexey Antipin and others.
 * https://github.com/Evreke/warships
 *
 * Licensed under the Apache License 2.0
 */

import kotlinx.serialization.Serializable

@Serializable
sealed class Ship(
  val size: Int,
  val direction: Direction,
)

class SmallShip(
  direction: Direction,
  size: Int = 1,
) : Ship(size, direction)

class MediumShip(
  direction: Direction,
  size: Int = 2,
) : Ship(size, direction)

class BigShip(
  direction: Direction,
  size: Int = 3,
) : Ship(size, direction)

class HugeShip(
  direction: Direction,
  size: Int = 4,
) : Ship(size, direction)

enum class Direction {
  HORIZONTAL,
  VERTICAL
}

enum class ShipType(val size: Int) {
  SMALL_SHIP(1),
  MEDIUM_SHIP(2),
  BIG_SHIP(3),
  HUGE_SHIP(4),
}